﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.ServiceModel;

namespace Zen4SyncOrchestratorHost
{
    public partial class Zen4SyncOrchestratorHost : ServiceBase
    {
        private ServiceHost zen4SyncOrchestratorServicesHost = null;

        public Zen4SyncOrchestratorHost()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            // Start the host for the Zen4SyncOrchestrator
            zen4SyncOrchestratorServicesHost = new ServiceHost(typeof(Zen4SyncOrchestrator.OrchestratorServices));
            zen4SyncOrchestratorServicesHost.Open();
        }

        protected override void OnStop()
        {
            // Close the host for the Zen4SyncOrchestrator
            if (zen4SyncOrchestratorServicesHost != null)
            {
                zen4SyncOrchestratorServicesHost.Close();
            }            
        }
    }
}
